const { override, addWebpackPlugin, fixBabelImports, addLessLoader, addWebpackAlias } = require("customize-cra");
const path = require("path");

const AntdDayjsWebpackPlugin = require("antd-dayjs-webpack-plugin");

module.exports = function override(config, env) {
    // do stuff with the webpack config...
    return config;
};

module.exports = override(
    // antd按需加载
    fixBabelImports("import", {
        libraryName: "antd",
        libraryDirectory: "es",
        style: true
    }),
    addLessLoader({
        javascriptEnabled: true,
        modifyVars: {
            "@primary-color": "#1DA57A",
            "@link-color": "#1DA57A",
        }
    }),
    addWebpackPlugin(new AntdDayjsWebpackPlugin()),
    // 配置路径别名
    addWebpackAlias({
        "@": path.join(__dirname, "./src")
    })


);
